<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>商品详情页</title>
    <link rel="stylesheet" href="./assets/mui/css/mui.min.css">
    <link rel="stylesheet" href="./assets/fontAwesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="./css/detail.css">
    <script src="./assets/zepto/zepto.min.js"></script>
    <script src="./assets/mui/js/mui.min.js"></script>
    <script src="./assets/artTemplate/template-native.js"></script>
    <script src="./js/public.js"></script>
    <script src="./js/detail.js"></script>
</head>

<body>
    <!-- 顶部部分 -->
    <header class="mui-bar mui-bar-nav myheader">
        <a href="#" class="mui-icon mui-icon-arrowleft mui-pull-left"></a>
        <h1 class="mui-title">商品详情</h1>
    </header>
    <!-- 内容部分 -->
    <div class="detail-content">
        <div class="newdata"></div>
        <script type="text/template" id="tem-detail">
            <!-- 商品轮播图 -->
            <div class="mui-slider">
                <div class="mui-slider-group">
                    <% for(var i=0;i<pic.length;i++){ %>
                        <div class="mui-slider-item">
                            <a href="#"><img src="<%=pic[i].picAddr %>" /></a>
                        </div>
                        <% } %>
                </div>
            </div>
            <!-- name -->
            <div class="name">
                <%=proName %>
            </div>
            <div class="price">
                <span>价格：</span>
                <span><%=price %></span>
                <span><%=oldPrice %></span>
            </div>
            <div class="size">
                尺码：
                <!-- 返回的size为字符串 “30-50”
                    js代码可以直接写在模板引擎里，用<%%> 包括 -->
                <% var size=size.split('-') %>
                    <% for(var i=size[0];i<size[1];i++){ %>
                        <span><%=i %></span>
                        <% } %>
            </div>
            <div class="num">
                <p>数量：</p>
                <span class="sub">-</span>
                <input type="text" value="1">
                <span class="add">+</span>
                <p class="solo">剩余
                    <%=num %>件</p>
            </div>
        </script>
        <div class="btns">
            <span>查看购物车</span>
            <span id="addcar">加入购物车</span>
        </div>
    </div>
    <!-- 底部导航 -->
    <nav class="mui-bar mui-bar-tab footer">
        <a class="mui-tab-item" href="index.html">
            <span class="mui-icon mui-icon-home"></span>
            <span class="mui-tab-label">首页</span>
        </a>
        <a class="mui-tab-item" href="category.html">
            <span class="mui-icon mui-icon-bars"></span>
            <span class="mui-tab-label">分类</span>
        </a>
        <a class="mui-tab-item" href="cart.html">
            <i class="mui-icon fa fa-shopping-cart" aria-hidden="true"></i>
            <span class="mui-tab-label">购物车</span>
        </a>
        <a class="mui-tab-item" href="user.html">
            <span class="mui-icon mui-icon-person"></span>
            <span class="mui-tab-label">会员中心</span>
        </a>
    </nav>
</body>

</html>